package com.com.hefei.wdp.example.service;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Service;

/**
 * feign 与 hystrix 结合 ，配置服务熔断降级处理
 */
@Service
public class HystrixFallbackFactory implements FallbackFactory<ProducerService> {


    @Override
    public ProducerService create(Throwable throwable) {
        return new ProducerService(){
            @Override
            public String getAppInfo() {
                return "feign 客户端降级。。。。";
            }
        };
    }
}
